import Base from './Base'

class ProductType extends Base {
  constructor ({
    id = '',
    name = '',
    sort = 0
  }) {
    super({id})

    this.name = name
    this.sort = sort
  }

  static async find (params) {
    let res = await Base.$http.get(`${ProductType.$name}/list`, {params})
    return res.map(v => new this(v))
  }
}
// 静态属性
ProductType.$name = '/product/type'
export default ProductType
